/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidad;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author HERX
 */
//@Entity
//@Table(name="ARTISTS")

@Entity
@DiscriminatorValue("ARTIST")
public class Artist extends Person {
               
    @OneToMany
    private List<Song> songs ;

    public List<Song> getSongs() {
        return songs;
    }
    
    public void addSong (Song song) {
       if (this.songs == null){
           this.songs= new ArrayList<Song>();
       }
       //song.setCompositor(this);
       this.songs.add(song);     
    }
}
